﻿
Chenxin.UI.PersonalCenter = Chenxin.extend(Chenxin.UI.PageCommon, {
    autoInitForm: false,
    actionUrl: '/service/UploadHeadPic.ashx',
    initEvent: function() {
        var _this = this;

        $('#upheadpic').click(function(){
            _this.showUploadHeadPic();
	    });
        
    },
    showUploadHeadPic: function(){
        var _this = this;

        if (!this.UploadHeadPicForm) {
            this.UploadHeadPicForm = new Chenxin.UI.UploadHeadPicForm({
                scrop: _this
            });
        }

        if(this.UploadHeadPicForm.show()) {
            this.UploadHeadPicForm.reset();
            this.UploadHeadPicForm.setTitle('编辑头像');
            document.getElementById('avatar_editor').innerHTML = '';
        }  
    },
    initComponent: function() {
        Chenxin.UI.PersonalCenter.superclass.initComponent.call(this);
    }
}); 

$(document ).ready(function(){
	$('#btn_startwork').click(function(){
		remarkWork('Start');
	});
	
	$('#btn_endwork').click(function(){
		if(confirm('确定要登记下班吗？')){
			remarkWork('End');	
		}
	});

	swfobject.embedSWF("flashchart/open-flash-chart.swf", "my_chart", "600", "300", "9.0.0", "expressInstall.swf",{"data-file":"service/personalcenter.ashx?op=dashbord"},{wmode:'transparent'});
	
	this.PersonalCenter=new Chenxin.UI.PersonalCenter();
	
});
function remarkWork(worktype){
	Chenxin.ajax({
		url:'/service/personalcenter.ashx?op=remarkwork',
		type:'get',
		data:{worktype:worktype},
		onSuccess:function(data,msg){
			alert(msg);
		}
	});
}